package com.frank.config;

import com.frank.entity.AutowiredAnno;
import com.frank.entity.Blue;
import com.frank.entity.ValueAnno;
import org.springframework.context.annotation.*;

/**
 * @Author: huweifeng
 * @Date: 2022/11/28
 * @Description: 属性注入相关配置类
 **/
@Configuration
@ComponentScan("com.frank.entity")
public class AutowiredConfig {
    // 第二种：通过@Bean定义的Blue对象
    @Bean("blue2")
    @Primary
    public Blue blue() {
        Blue blue = new Blue();
        blue.setId(2);
        return blue;
    }

    @Bean
    public AutowiredAnno autowiredAnno() {
        return new AutowiredAnno();
    }
}
